public class printf {
    public static void printf (int x){
        if (x>9){
            printf (x / 10);
        }
        System.out.println(x%10+" ");
    }
    public static void main(String[] args) {
        int n = 1234;
        printf(n);
    }
}
